package com.game.logic;

import com.game.logic.messages.GameMessageServerBoot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication
@ComponentScan(basePackages = {"com.game.logic","com.game.framework"})
@EnableMongoRepositories(basePackages = { "com.game.framework.dao" })
public class LogicServerApplication {
	//启动业务逻辑服务器
	public static void main(String[] args) {
		ApplicationContext applicationContext = SpringApplication.run(LogicServerApplication.class, args);

		GameMessageServerBoot gameMessageServerBoot = applicationContext.getBean(GameMessageServerBoot.class);
		gameMessageServerBoot.run(applicationContext, args);

//		ClientNettyServerBoot clientNettyServerBoot = applicationContext.getBean(ClientNettyServerBoot.class);
//		clientNettyServerBoot.startServer(applicationContext);
	}

}
